<style type="text/css">
body.home {background-color: #fff;}
.kv1 { background-image: none !important;}
.nav-tabs li.active a {font-family: fContentBold;border-color: transparent;color: #111;text-decoration: underline;
}
</style>
<section>
    <div class="container">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
            <nav class="subnav">
                <h2 class="navheader"><?php echo $cates['catname'] ?></h2>
                <ul class="nav nav-tabs nav-stacked">
                   <?php $catName = strtolower(str_replace(' ', '', $cates['catname'])) ?>
                   <?php if(! empty($cates['data']) && is_array($cates['data'])): ?>
                        <?php foreach ($cates['data'] as $k=> $v):?>

                            <?php if(empty($v['data'])){ ?>

                                <?php if($v['cattype'] == 1){ ?>
                                    <li role="presentation" <?php if($k == $recentid){ ?>class="active"<?php } ?>><a href="<?php echo site_url($catName.'/article/'.$v['cid']) ?>"><?php echo $v['catname'] ?></a></li>
                                <?php }else if($v['cattype'] == 2){ ?>
                                    <?php $catNameChild = strtolower(str_replace(' ', '', $v['catname'])); ?>
                                    <li role="presentation" <?php if($k == $recentid){ ?>class="active"<?php } ?>><a href="<?php echo site_url($catName.'/'.$catNameChild) ?>"><?php echo $v['catname'] ?></a></li>
                                <?php } ?>

                            <?php }else{?>

                                <?php if(is_array($v['data'])){ ?>
                                    <li role="presentation"><span><?php echo $v['catname'] ?></span>
                                        <ul>
                                            <?php foreach ($v['data'] as $ke=>$va):?>
                                                <?php if($va['cattype'] == 1){ ?>
                                                    <li role="presentation" <?php if($ke == $recentid){ ?>class="active"<?php } ?>><a href="<?php echo site_url($catName.'/article/'.$va['cid']) ?>"><?php echo $va['catname'] ?></a></li>
                                                <?php }else if($va['cattype'] == 2){ ?>
                                                    <?php $catNameChild = strtolower(str_replace(' ', '', $va['catname'])); ?>
                                                    <li role="presentation" <?php if($ke == $recentid){ ?>class="active"<?php } ?>><a href="<?php echo site_url($catName.'/'.$catNameChild) ?>"><?php echo $va['catname'] ?></a></li>
                                                <?php } ?>
                                            <?php endforeach; ?>

                                        </ul>
                                    </li>
                                <?php } ?>

                            <?php } ?>

                        <?php endforeach; ?>
                    <?php endif; ?>
                </ul>
            </nav>
        </div>